From 1908c5cf4384f670c94a6e448162f2dc3e8d0a9f Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 27 Apr 2009 15:40:09 +0100 Subject: [PATCH] x86 hvm: During task switch, LDT must be loaded before all other segments, as some may be loaded from the LDT. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/hvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 82b99ab761..a2c23e09f1 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1440,13 +1440,13 @@ void hvm_task_switch( } exn_raised = 0; - if ( hvm_load_segment_selector(v, x86_seg_es, tss.es) || + if ( hvm_load_segment_selector(v, x86_seg_ldtr, tss.ldt) || + hvm_load_segment_selector(v, x86_seg_es, tss.es) || hvm_load_segment_selector(v, x86_seg_cs, tss.cs) || hvm_load_segment_selector(v, x86_seg_ss, tss.ss) || hvm_load_segment_selector(v, x86_seg_ds, tss.ds) || hvm_load_segment_selector(v, x86_seg_fs, tss.fs) || - hvm_load_segment_selector(v, x86_seg_gs, tss.gs) || - hvm_load_segment_selector(v, x86_seg_ldtr, tss.ldt) ) + hvm_load_segment_selector(v, x86_seg_gs, tss.gs) ) exn_raised = 1; rc = hvm_copy_to_guest_virt( -- 2.30.2